public class PC {
    CPU cpu;
    HardDisk HD;

    // 将参数c的值赋给cpu
    public void setCPU(CPU c){
        this.cpu = c;
    }

    // 将参数h的值赋给HD
    public void setHarDisk(HardDisk h){
        this.HD = h;
    }

    // 显示CPU的速度和硬盘的容量
    public void show(){
        System.out.println("CPU速度:" + cpu.getSpeed());
        System.out.println("硬盘容量:" + HD.getAmount());
    }
}
